package TI;

import java.util.Date;
import java.util.List;

import org.joda.time.DateTime;

import Exceptions.ProductSalesPriceNeverSetException;
import Magnitudes.Money;
import Magnitudes.Pesos;
import Products.Presentation;


public class Sale {
	
	 Date date;
	 List<Presentation> products;
	 BranchOffice branchOffice;
	 Customer customer;
	
	
	 public Date getDate(){
		return this.date;
	}
	
	
	public List<Presentation> getProducts(){
		return this.products;
	}
	
	
	
	public Money amount() throws ProductSalesPriceNeverSetException{
		double monto = 0;
		for(Presentation presentation: products){
			monto = monto + presentation.getUnitSalesPrice().amount();
		}
		return (new Pesos(monto));
	}
	
	
	

}
